package cn.oracle.eshop.auth.mapper;

import cn.oracle.eshop.auth.domain.PriorityDo;

import jdk.nashorn.internal.runtime.FindProperty;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;


import java.util.List;

/**
 * 权限管理模块的mapper组件
 * @author wyh
 * @date 2022/1/12
 * @param
 * @return
*/

@Mapper
public interface PriorityDoMapper {
   //PriorityDoMapper ps= Mappers.getMapper(PriorityDoMapper.class);
/****
 * 获取根权限
 * @author wyh
 * @date 2022/1/12
 * @param
 * @return 根权限集合
*/
List<PriorityDo>listRootPriorites();

void FindPropertyById();
 // updatePropertyById();
    /***
     *  根据父权限id查询子权限的
     * @author wyh
     * @date 2022/1/22
     * @param parentId 父权限ID
     * @return  子权限
    */


    List<PriorityDo>listChildPriorities(@Param("parentId") Long parentId);
    /***
     * 查询权限
     * @author wyh
     * @date 2022/1/22
     * @param id  权限DO对象
     * @return void
    */
    PriorityDo getPriorityById(@Param("id") long id);

    /****
     * 新增权限
     * @author wyh
     * @date 2022/1/22
     * @param priorityDo
     * @return void
    */
    @Options(useGeneratedKeys = true,keyProperty = "id")
    void savePriority(PriorityDo priorityDo);
    /***
     *  更新权限
     * @author wyh
     * @date 2022/1/22
     * @param priorityDo
     * @return void
    */

    void updatePriorityDo (PriorityDo priorityDo);
    /***
     *  删除权限
     * @author wyh
     * @date 2022/1/22
     * @param id  权限ID
     * @return void
    */

    void removePriority(Long id);
}

